<include file="Public:header" />
<div class="headbar">
	<div class="position"><span>商户</span><span>></span><span>文章管理</span><span>></span><span>文章列表</span></div>
	<div class="operating">
		<a href="{:U('Article/article_edit')}"><button class="operating_btn" type="button"><span class="addition">添加文章</span></button></a>
		<a href="javascript:void(0)" onclick="selectAll('id[]');"><button class="operating_btn" type="button"><span class="sel_all">全选</span></button></a>
		<a href="javascript:void(0)" onclick="delModel();"><button class="operating_btn" type="button"><span class="delete">批量删除</span></button></a>
	</div>
</div>

<div class="wxeditor">
	<div id="previewbox" style="display:none;">
		<div style="height: 85%; overflow-y: scroll; padding-right: 5px;">
			<div style="font-size: 18px; line-height: 24px; font-weight: 700">{$info.title}</div>
			<div>
				<em style="color: #8c8c8c; font-style: normal; font-size: 12px;">{$info.create_time}</em>
				<a style="font-size: 12px; color: #607fa6"
					href="javascript:void(0);" id="post-user"></a>
			</div>
			<div id="preview" class="preview"></div>
		</div>

		<div
			style="position: absolute; right: 50px; top: 40px; cursor: pointer; width: 50px; height: 50px; font-size: 50px; font-weight: 700"
			id="phoneclose">X</div>
	</div>
</div>

<div class="content">
	<form action="{:U('Article/article_del')}" method="post" name="article">
		<table class="list_table">
			<colgroup>
				<col width="40px" />
				<col width="250px" />
				<col width="100px" />
				<col width="150px" />
				<col width="60px" />
				<col width="60px" />
				<col width="60px" />
				<col width="110px" />
			</colgroup>

			<thead>
				<tr>
					<th>选择</th>
					<th>标题</th>
					<th>文章分类</th>
					<th>发布时间</th>
					<th>展示</th>
					<th>首页推荐</th>
					<th>排序</th>
					<th>操作</th>
				</tr>
			</thead>

			<tbody>
				<foreach name='articles' item='item'><tr>
					<td><input type="checkbox" name="id[]" value="{$item['id']}" /></td>
					<td><a href="javascript:void(0);" onclick="xiang('{$item.id}')" title='查看'>{$item['title']}</a></td>
					<td>{$item['name']}</td>
					<td>{$item['create_time']}</td>
					<td><if condition="$item['visibility'] eq 1">是<else/>否</if></td>
					<td><if condition="$item['top'] eq 1">是<else/>否</if></td>
					<td>{$item['sort']}</td>
					<td>
						<a href="{:U('Article/article_edit', array('id' => $item[id]))}"><img class="operator" src="__PUBLIC__/Operation/images/admin/icon_edit.gif" alt="编辑" title="编辑" /></a>
						<a href="javascript:void(0);" onclick="xiang('{$item.id}')"><img class="operator" src="__PUBLIC__/Operation/images/admin/icon_check.gif" alt="查看" title="查看" /></a>
						<a href='javascript:void(0)' onclick="delModel({link:{:U('Article/article_del',array(id=>$item[id]))}});"><img class="operator" src="__PUBLIC__/Operation/images/admin/icon_del.gif" alt="删除" title="删除" /></a>
					</td>
				</tr>
                                </foreach>
			</tbody>
		</table>
	</form>
</div>
{$page}
<script>
//商品详情
function xiang(idd){
	if ($("#previewbox").css("display") == "block") {
		$("#previewbox").hide()
	} else {
		$("#previewbox").show()
	}
	var add = document.getElementById('preview');
    $.ajax({
        type: "POST",
        url: "{:U('Article/home1')}",
        data:{id:idd},
        dataType: "json",
        success: function(e){
        	if(e.status==1){	
        		add.innerHTML = e.data;
        	}	
        },
        error: function(){
        }
    });	
}
$(function(){
	$("#phoneclose").on('click', function() {
		$("#previewbox").hide()
	});
});
</script>
<include file="Public:footer" />
